home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Aventura / TheBearsAdventure.swf / scripts / frame_6 / PlaceObject2_145_67 / CLIPACTIONRECORD onClipEvent(enterFrame).as
Encoding:
Text File  |  2005-08-04  |  6.9 KB  |  182 lines

  1. onClipEvent(enterFrame){
  2.    if(_visible)
  3.    {
  4.       if(_currentframe == 1 || _currentframe == 2)
  5.       {
  6.          if(_X <= 0 || _X >= 800 || step > 11)
  7.          {
  8.             gotoAndPlay(3);
  9.          }
  10.          else
  11.          {
  12.             _X = _X + speedx;
  13.             _Y = _Y + speedy;
  14.             step++;
  15.             if(step > 6)
  16.             {
  17.                if(Math.abs(speedx) > 2)
  18.                {
  19.                   if(speedx > 0)
  20.                   {
  21.                      speedx -= 2;
  22.                   }
  23.                   else
  24.                   {
  25.                      speedx += 2;
  26.                   }
  27.                }
  28.             }
  29.             speedy += 2;
  30.             var i = -7;
  31.             for(; i <= 7; i += 14)
  32.             {
  33.                cx = Math.floor((_X + i) / 40);
  34.                cy = Math.floor(_Y / 40);
  35.                switch(_level0.pole[cy][cx])
  36.                {
  37.                   case 0:
  38.                      continue;
  39.                   case 1:
  40.                      if(_level0.pole[Math.floor((_Y + 8) / 40)][cx] != 0)
  41.                      {
  42.                         break;
  43.                      }
  44.                      continue;
  45.                   case 2:
  46.                      break;
  47.                   case 3:
  48.                      if(_Y - cy * 40 >= 40 - (_X - cx * 40))
  49.                      {
  50.                         gotoAndPlay(2);
  51.                      }
  52.                      continue;
  53.                   case 4:
  54.                      if(_Y - cy * 40 >= _X - cx * 40)
  55.                      {
  56.                         gotoAndPlay(2);
  57.                      }
  58.                      continue;
  59.                   default:
  60.                      continue;
  61.                }
  62.                gotoAndPlay(3);
  63.             }
  64.             monster_hit = false;
  65.             var dy = -7;
  66.             while(dy <= 7)
  67.             {
  68.                var dx = -7;
  69.                while(dx <= 7)
  70.                {
  71.                   var i = 1;
  72.                   while(i <= _level0.num_monsters)
  73.                   {
  74.                      if(!monster_hit && eval("_level0.monster" + i) != undefined)
  75.                      {
  76.                         if(!eval("_level0.monster" + i).boss && (_X + dx >= eval("_level0.monster" + i)._x - 6 && _X + dx <= eval("_level0.monster" + i)._x + 8) && (_Y + dy >= eval("_level0.monster" + i)._y - 11 && _Y + dy <= eval("_level0.monster" + i)._y + 28))
  77.                         {
  78.                            if(!eval("_level0.monster" + i).snow_ball)
  79.                            {
  80.                               _level0.snowball_count = _level0.snowball_count + 1;
  81.                               _level0.flyscore.duplicateMovieClip("flyscore" + _level0.snowball_count,1000 + _level0.snowball_count);
  82.                               eval("_level0.flyscore" + _level0.snowball_count).value = 10;
  83.                               eval("_level0.flyscore" + _level0.snowball_count).x = _X;
  84.                               eval("_level0.flyscore" + _level0.snowball_count).y = _Y;
  85.                               eval("_level0.flyscore" + _level0.snowball_count)._visible = true;
  86.                            }
  87.                            if(_currentframe == 1)
  88.                            {
  89.                               eval("_level0.monster" + i).frozen_count += 22;
  90.                            }
  91.                            else
  92.                            {
  93.                               eval("_level0.monster" + i).frozen_count += 44;
  94.                            }
  95.                            if(eval("_level0.monster" + i).frozen_count > 99)
  96.                            {
  97.                               eval("_level0.monster" + i).frozen_count = 174;
  98.                            }
  99.                            eval("_level0.monster" + i).snow_ball_hit = true;
  100.                            eval("_level0.monster" + i).ai_sost = 9;
  101.                            monster_hit = 3;
  102.                            gotoAndPlay(3);
  103.                            break;
  104.                         }
  105.                      }
  106.                      i++;
  107.                   }
  108.                   dx += 14;
  109.                }
  110.                dy += 14;
  111.             }
  112.             if(_level0.monster_clock1 != undefined)
  113.             {
  114.                if(_X >= _level0.monster_clock1._x - 20 && _X <= _level0.monster_clock1._x + 20 && (_Y >= _level0.monster_clock1._y - 32 && _Y <= _level0.monster_clock1._y + 32))
  115.                {
  116.                   _level0.snowball_count = _level0.snowball_count + 1;
  117.                   _level0.flyscore.duplicateMovieClip("flyscore" + _level0.snowball_count,1000 + _level0.snowball_count);
  118.                   eval("_level0.flyscore" + _level0.snowball_count).value = 10;
  119.                   eval("_level0.flyscore" + _level0.snowball_count).x = _X;
  120.                   eval("_level0.flyscore" + _level0.snowball_count).y = _Y;
  121.                   eval("_level0.flyscore" + _level0.snowball_count)._visible = true;
  122.                   gotoAndPlay(3);
  123.                }
  124.                var i = 1;
  125.                while(i <= _level0.monster_clock1.ghost_count)
  126.                {
  127.                   if(eval("_level0.monster_ghost" + i) != undefined)
  128.                   {
  129.                      if(_X >= eval("_level0.monster_ghost" + i)._x - 12 && _X <= eval("_level0.monster_ghost" + i)._x + 12 && (_Y >= eval("_level0.monster_ghost" + i)._y - 10 && _Y <= eval("_level0.monster_ghost" + i)._y + 10))
  130.                      {
  131.                         _level0.snowball_count = _level0.snowball_count + 1;
  132.                         _level0.flyscore.duplicateMovieClip("flyscore" + _level0.snowball_count,1000 + _level0.snowball_count);
  133.                         eval("_level0.flyscore" + _level0.snowball_count).value = 10;
  134.                         eval("_level0.flyscore" + _level0.snowball_count).x = _X;
  135.                         eval("_level0.flyscore" + _level0.snowball_count).y = _Y;
  136.                         eval("_level0.flyscore" + _level0.snowball_count)._visible = true;
  137.                         gotoAndPlay(3);
  138.                         break;
  139.                      }
  140.                   }
  141.                   i++;
  142.                }
  143.             }
  144.          }
  145.       }
  146.    }
  147.    if(_currentframe == 8)
  148.    {
  149.       i = _level0.snowball_count;
  150.       while(i > 0)
  151.       {
  152.          if(eval("_level0.snowball" + i) != undefined && "/snowball" + i != _target)
  153.          {
  154.             break;
  155.          }
  156.          if(eval("_level0.flyscore" + i) != undefined)
  157.          {
  158.             break;
  159.          }
  160.          if(eval("_level0.bonus_hint" + i) != undefined)
  161.          {
  162.             break;
  163.          }
  164.          if(eval("_level0.bubbleballsplinter" + i) != undefined)
  165.          {
  166.             break;
  167.          }
  168.          if(eval("_level0.bubbleball" + i) != undefined)
  169.          {
  170.             break;
  171.          }
  172.          if(eval("_level0.bonus" + i) != undefined)
  173.          {
  174.             break;
  175.          }
  176.          i--;
  177.       }
  178.       _level0.snowball_count = i;
  179.       this.removeMovieClip();
  180.    }
  181. }
  182.